import React, { Component } from 'react'
import { Link } from 'react-router-dom'
import store from '../store'
export default class home extends Component {
    constructor(props){
        super(props);
        this.state = {
            msg: store.getState(),
            test:"test"
        }
    }
    componentDidMount(){
        console.log(store.getState());
        console.log(store);
        console.log(this.state.msg);
    }
    render() {
        return (
            <div>
                home
                <Link to='/detail'>武汉</Link>
                <button onClick={this.changeState}>更改state</button>
            </div>
        )
    }
    changeState(){
        var action ={
            type:'1001',
            value:"已经改变!"
        }
        store.dispatch(action)
    }
}
